package com.cxcy.swustlearner.mapper;

import com.cxcy.swustlearner.pojo.HomeWork;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HomeworkMapper {
    @Select("select * from homework")
    List<HomeWork> getHomeWork();
    @Insert("insert into homework (homework_name, start_time, end_time, homework_content, publisher_id, homework_type) VALUES (#{homeworkName},NOW(),NOW(),#{homeworkContent},#{publishId},#{type})")
    void insertHomeWork(HomeWork homeWork);
    void updateHomeWork(HomeWork homeWork);
}